package com.mvvm.demo.http.service

import com.mvvm.base.base.BaseResult
import com.mvvm.demo.entity.UserInfo
import okhttp3.RequestBody
import org.json.JSONObject
import retrofit2.http.Body
import retrofit2.http.Header
import retrofit2.http.Headers
import retrofit2.http.POST

interface LoginService {

    @Headers("Content-Type: application/json", "Accept: application/json")//需要添加头
    @POST("https://apigw.gialen.com/app/req/user.getLoginRegistryVerification")
    suspend fun getVerficationCode(
            @Header("sign") sign: String,
            @Header("reqDate") reqDate: String,
            @Body requestBody: RequestBody
    ): BaseResult<JSONObject>
    @Headers("Content-Type: application/json", "Accept: application/json")//需要添加头
    @POST("https://apigw.gialen.com/app/login")
    suspend fun login(@Header("sign") sign: String,
                      @Header("reqDate") reqDate: String,
                      @Body requestBody: RequestBody
    ): BaseResult<UserInfo>

}